package org.cuadroanotacionapi.persistencia;

import org.cuadroanotacionapi.beans.Jos_fastball_schedule;
import java.sql.Timestamp;
import java.sql.Time;
import org.cuadroanotacionapi.beans.*;
import org.cuadroanotacionapi.controller.*;
import java.io.Serializable;
import java.util.List;
import java.util.ArrayList;
import java.util.*;
import java.sql.Connection;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.PreparedStatement;
import java.util.Map;
import java.util.Iterator;
import java.util.HashMap;
import java.util.Map;
 import javax.sql.DataSource;
import org.cuadroanotacionapi.generales.Mensajeria;
import org.cuadroanotacionapi.generales.Sesion;


/**
*
* @author
*/

public class Jos_fastball_schedulePersistencia implements Serializable {
private static final long serialVersionUID = 1L;
public static Exception excepcion;
public static boolean esMensaje = false;
public static Connection con = null;

public Jos_fastball_schedulePersistencia(){
         esMensaje =false;
}


/**
*
* Insertar()
*/

public static boolean Insertar (Jos_fastball_schedule jos_fastball_schedule ) {
  excepcion = null;
  try {
      esMensaje =false;
   
   
   
     if (!Conectar()) {
         return false;
      }
      PreparedStatement pinsert = null;
      String sql = "insert into jos_fastball_schedule(id,season,leagueid,divisionid,visitingteam,hometeam,gamedatetime,gametimezone,gametype,location,field,status,boxscored,extrainfo,innings,linescore,homeroster,awayroster,homestats,awaystats,runshome,hitshome,errorshome,runsaway,hitsaway,errorsaway,scored,gameinfo,checked_out,checked_out_time,published)  values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
      pinsert = con.prepareStatement(sql);
              pinsert.setInt(1,jos_fastball_schedule.getId());
        pinsert.setInt(2,jos_fastball_schedule.getSeason());
        pinsert.setInt(3,jos_fastball_schedule.getLeagueid());
        pinsert.setInt(4,jos_fastball_schedule.getDivisionid());
        pinsert.setInt(5,jos_fastball_schedule.getVisitingteam());
        pinsert.setInt(6,jos_fastball_schedule.getHometeam());
        pinsert.setTimestamp(7,jos_fastball_schedule.getGamedatetime());
        pinsert.setString(8,jos_fastball_schedule.getGametimezone());
        pinsert.setInt(9,jos_fastball_schedule.getGametype());
        pinsert.setInt(10,jos_fastball_schedule.getLocation());
        pinsert.setString(11,jos_fastball_schedule.getField());
        pinsert.setInt(12,jos_fastball_schedule.getStatus());
        pinsert.setString(13,jos_fastball_schedule.getBoxscored());
        pinsert.setString(14,jos_fastball_schedule.getExtrainfo());
        pinsert.setInt(15,jos_fastball_schedule.getInnings());
        pinsert.setString(16,jos_fastball_schedule.getLinescore());
        pinsert.setString(17,jos_fastball_schedule.getHomeroster());
        pinsert.setString(18,jos_fastball_schedule.getAwayroster());
        pinsert.setString(19,jos_fastball_schedule.getHomestats());
        pinsert.setString(20,jos_fastball_schedule.getAwaystats());
        pinsert.setInt(21,jos_fastball_schedule.getRunshome());
        pinsert.setInt(22,jos_fastball_schedule.getHitshome());
        pinsert.setInt(23,jos_fastball_schedule.getErrorshome());
        pinsert.setInt(24,jos_fastball_schedule.getRunsaway());
        pinsert.setInt(25,jos_fastball_schedule.getHitsaway());
        pinsert.setInt(26,jos_fastball_schedule.getErrorsaway());
        pinsert.setBoolean(27,jos_fastball_schedule.getScored());
        pinsert.setString(28,jos_fastball_schedule.getGameinfo());
        pinsert.setBoolean(29,jos_fastball_schedule.getChecked_out());
        pinsert.setTime(30,jos_fastball_schedule.getChecked_out_time());
        pinsert.setBoolean(31,jos_fastball_schedule.getPublished());
      int filas= pinsert.executeUpdate();
      pinsert.close();
      con.close();
      return true;
   } catch (Exception e) {
      excepcion = e;
   } finally {
  }
  return false;
 }


/**
*
* Editar()
*/

public static boolean Editar(Jos_fastball_schedule jos_fastball_schedule ) {
  excepcion = null;
  try {
      esMensaje =false;
     if (!Conectar()) {
         return false;
      }
      PreparedStatement pupdate = null;
      String sql = "update jos_fastball_schedule set  id=?, season=?, leagueid=?, divisionid=?, visitingteam=?, hometeam=?, gamedatetime=?, gametimezone=?, gametype=?, location=?, field=?, status=?, boxscored=?, extrainfo=?, innings=?, linescore=?, homeroster=?, awayroster=?, homestats=?, awaystats=?, runshome=?, hitshome=?, errorshome=?, runsaway=?, hitsaway=?, errorsaway=?, scored=?, gameinfo=?, checked_out=?, checked_out_time=?, published=?  where  id ='"+jos_fastball_schedule.getId()+"'  ";
      pupdate= con.prepareStatement(sql);
      pupdate.setInt(1,jos_fastball_schedule.getId());
pupdate.setInt(2,jos_fastball_schedule.getSeason());
pupdate.setInt(3,jos_fastball_schedule.getLeagueid());
pupdate.setInt(4,jos_fastball_schedule.getDivisionid());
pupdate.setInt(5,jos_fastball_schedule.getVisitingteam());
pupdate.setInt(6,jos_fastball_schedule.getHometeam());
pupdate.setTimestamp(7,jos_fastball_schedule.getGamedatetime());
pupdate.setString(8,jos_fastball_schedule.getGametimezone());
pupdate.setInt(9,jos_fastball_schedule.getGametype());
pupdate.setInt(10,jos_fastball_schedule.getLocation());
pupdate.setString(11,jos_fastball_schedule.getField());
pupdate.setInt(12,jos_fastball_schedule.getStatus());
pupdate.setString(13,jos_fastball_schedule.getBoxscored());
pupdate.setString(14,jos_fastball_schedule.getExtrainfo());
pupdate.setInt(15,jos_fastball_schedule.getInnings());
pupdate.setString(16,jos_fastball_schedule.getLinescore());
pupdate.setString(17,jos_fastball_schedule.getHomeroster());
pupdate.setString(18,jos_fastball_schedule.getAwayroster());
pupdate.setString(19,jos_fastball_schedule.getHomestats());
pupdate.setString(20,jos_fastball_schedule.getAwaystats());
pupdate.setInt(21,jos_fastball_schedule.getRunshome());
pupdate.setInt(22,jos_fastball_schedule.getHitshome());
pupdate.setInt(23,jos_fastball_schedule.getErrorshome());
pupdate.setInt(24,jos_fastball_schedule.getRunsaway());
pupdate.setInt(25,jos_fastball_schedule.getHitsaway());
pupdate.setInt(26,jos_fastball_schedule.getErrorsaway());
pupdate.setBoolean(27,jos_fastball_schedule.getScored());
pupdate.setString(28,jos_fastball_schedule.getGameinfo());
pupdate.setBoolean(29,jos_fastball_schedule.getChecked_out());
pupdate.setTime(30,jos_fastball_schedule.getChecked_out_time());
pupdate.setBoolean(31,jos_fastball_schedule.getPublished());
      int filas= pupdate.executeUpdate();
      pupdate.close();
      con.close();
      if (filas <= 0){
          excepcion = new Exception("No se pudo actualizar");
          esMensaje =true;
          return false;
      }
      return true;
   } catch (Exception e) {
      excepcion = e;
   } finally {
  }
  return false;
}


/**
*
* Editar()
*/

public static boolean Editar(String sqlupdate ) {
  excepcion = null;
  try {
      esMensaje =false;
     if (!Conectar()) {
         return false;
      }
      PreparedStatement pupdate = null;
      String sql = "update  jos_fastball_schedule set " + sqlupdate +"";
      pupdate= con.prepareStatement(sql);
      int filas= pupdate.executeUpdate();
      pupdate.close();
      con.close();
      if (filas <= 0){
          excepcion = new Exception("No se pudo editar");
           esMensaje =true;
          return false;
      }
      return true;
   } catch (Exception e) {
      excepcion = e;
   } finally {
  }
  return false;
}


/**
*
* EditarClavePrimaria()
*/

public static boolean EditarClavePrimaria(Jos_fastball_schedule jos_fastball_schedule_old , Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
     if (!Conectar()) {
         return false;
      }
      PreparedStatement pupdate = null;
      String sql = "update jos_fastball_schedule set  id=?  where  id ='"+jos_fastball_schedule_old.getId()+"'  ";
      pupdate= con.prepareStatement(sql);
      pupdate.setInt(1,jos_fastball_schedule.getId());
      int filas= pupdate.executeUpdate();
      pupdate.close();
      con.close();
      if (filas <= 0){
          excepcion = new Exception("No se pudo actualizar");
          esMensaje =true;
          return false;
      }
      return true;
   } catch (Exception e) {
      excepcion = e;
   } finally {
  }
  return false;
}


/**
*
* Eliminar()
*/

public static boolean Eliminar(Jos_fastball_schedule jos_fastball_schedule ) {
  excepcion = null;
  try {
      esMensaje =false;
     if (!Conectar()) {
         return false;
      }
      PreparedStatement pdelete = null;
      String sql = "delete from jos_fastball_schedule  where  id = ?  ";
      pdelete= con.prepareStatement(sql);
      pdelete.setInt(1,jos_fastball_schedule.getId());
      int filas= pdelete.executeUpdate();
      pdelete.close();
      con.close();
      if (filas <= 0){
          excepcion = new Exception("No se pudo eliminar");
           esMensaje =true;
          return false;
      }
      return true;
   } catch (Exception e) {
      excepcion = e;
   } finally {
  }
  return false;
}


/**
*
* EliminarSQL()
*/

public static boolean Eliminar(String sqldelete ) {
  excepcion = null;
  try {
      esMensaje =false;
     if (!Conectar()) {
         return false;
      }
      PreparedStatement pdelete = null;
      String sql = "delete from jos_fastball_schedule where " + sqldelete +"";
      pdelete= con.prepareStatement(sql);
      int filas= pdelete.executeUpdate();
      pdelete.close();
      con.close();
      if (filas <= 0){
          excepcion = new Exception("No se pudo eliminar");
           esMensaje =true;
          return false;
      }
      return true;
   } catch (Exception e) {
      excepcion = e;
   } finally {
  }
  return false;
}


/**
*
* ElimninarTodos()
*/

public static boolean EliminarTodos() {
  excepcion = null;
  try {
      esMensaje =false;
     if (!Conectar()) {
         return false;
      }
      PreparedStatement pdelete = null;
      String sql = "delete from jos_fastball_schedule  ";
      pdelete= con.prepareStatement(sql);
      int filas= pdelete.executeUpdate();
      pdelete.close();
      con.close();
      if (filas <= 0){
          excepcion = new Exception("No se pudo eliminar todos los registros");
           esMensaje =true;
          return false;
      }
      return true;
   } catch (Exception e) {
      excepcion = e;
   } finally {
  }
  return false;
}


/**
*
* ExisteRegistro()
*/



public static boolean ExisteRegistro(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return false;
      }
      String sql = "select * from jos_fastball_schedule where id='"+jos_fastball_schedule.getId()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return false;
   }
    rs.close();
    psquery.close();
    con.close();
 return true;
} catch (Exception ex) {
      excepcion = ex;
}
  return false;
}


/**
*
* findByPrimaryKey()
*/



public static Jos_fastball_schedule findByPrimaryKey(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      String sql = "select * from jos_fastball_schedule where id='"+jos_fastball_schedule.getId()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
            
            
            jos_fastball_schedule.setId(rs.getInt("id"));
jos_fastball_schedule.setSeason(rs.getInt("season"));
jos_fastball_schedule.setLeagueid(rs.getInt("leagueid"));
jos_fastball_schedule.setDivisionid(rs.getInt("divisionid"));
jos_fastball_schedule.setVisitingteam(rs.getInt("visitingteam"));
jos_fastball_schedule.setHometeam(rs.getInt("hometeam"));
jos_fastball_schedule.setGamedatetime(rs.getTimestamp("gamedatetime"));
jos_fastball_schedule.setGametimezone(rs.getString("gametimezone"));
jos_fastball_schedule.setGametype(rs.getInt("gametype"));
jos_fastball_schedule.setLocation(rs.getInt("location"));
jos_fastball_schedule.setField(rs.getString("field"));
jos_fastball_schedule.setStatus(rs.getInt("status"));
jos_fastball_schedule.setBoxscored(rs.getString("boxscored"));
jos_fastball_schedule.setExtrainfo(rs.getString("extrainfo"));
jos_fastball_schedule.setInnings(rs.getInt("innings"));
jos_fastball_schedule.setLinescore(rs.getString("linescore"));
jos_fastball_schedule.setHomeroster(rs.getString("homeroster"));
jos_fastball_schedule.setAwayroster(rs.getString("awayroster"));
jos_fastball_schedule.setHomestats(rs.getString("homestats"));
jos_fastball_schedule.setAwaystats(rs.getString("awaystats"));
jos_fastball_schedule.setRunshome(rs.getInt("runshome"));
jos_fastball_schedule.setHitshome(rs.getInt("hitshome"));
jos_fastball_schedule.setErrorshome(rs.getInt("errorshome"));
jos_fastball_schedule.setRunsaway(rs.getInt("runsaway"));
jos_fastball_schedule.setHitsaway(rs.getInt("hitsaway"));
jos_fastball_schedule.setErrorsaway(rs.getInt("errorsaway"));
jos_fastball_schedule.setScored(rs.getBoolean("scored"));
jos_fastball_schedule.setGameinfo(rs.getString("gameinfo"));
jos_fastball_schedule.setChecked_out(rs.getBoolean("checked_out"));
jos_fastball_schedule.setChecked_out_time(rs.getTime("checked_out_time"));
jos_fastball_schedule.setPublished(rs.getBoolean("published"));
    }
    rs.close();
    psquery.close();
    con.close();
 return jos_fastball_schedule;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findById()
*/

public static List<Jos_fastball_schedule> findById(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_schedule> list = new ArrayList<>();
      String sql = "select * from jos_fastball_schedule where id='"+jos_fastball_schedule.getId()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findBySeason()
*/

public static List<Jos_fastball_schedule> findBySeason(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_schedule> list = new ArrayList<>();
      String sql = "select * from jos_fastball_schedule where season='"+jos_fastball_schedule.getSeason()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByLeagueid()
*/

public static List<Jos_fastball_schedule> findByLeagueid(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_schedule> list = new ArrayList<>();
      String sql = "select * from jos_fastball_schedule where leagueid='"+jos_fastball_schedule.getLeagueid()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByDivisionid()
*/

public static List<Jos_fastball_schedule> findByDivisionid(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_schedule> list = new ArrayList<>();
      String sql = "select * from jos_fastball_schedule where divisionid='"+jos_fastball_schedule.getDivisionid()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByVisitingteam()
*/

public static List<Jos_fastball_schedule> findByVisitingteam(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_schedule> list = new ArrayList<>();
      String sql = "select * from jos_fastball_schedule where visitingteam='"+jos_fastball_schedule.getVisitingteam()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByHometeam()
*/

public static List<Jos_fastball_schedule> findByHometeam(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_schedule> list = new ArrayList<>();
      String sql = "select * from jos_fastball_schedule where hometeam='"+jos_fastball_schedule.getHometeam()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByGamedatetime()
*/

public static List<Jos_fastball_schedule> findByGamedatetime(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_schedule> list = new ArrayList<>();
      String sql = "select * from jos_fastball_schedule where gamedatetime='"+jos_fastball_schedule.getGamedatetime()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByGametimezone()
*/

public static List<Jos_fastball_schedule> findByGametimezone(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_schedule> list = new ArrayList<>();
      String sql = "select * from jos_fastball_schedule where gametimezone='"+jos_fastball_schedule.getGametimezone()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByGametype()
*/

public static List<Jos_fastball_schedule> findByGametype(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_schedule> list = new ArrayList<>();
      String sql = "select * from jos_fastball_schedule where gametype='"+jos_fastball_schedule.getGametype()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByLocation()
*/

public static List<Jos_fastball_schedule> findByLocation(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_schedule> list = new ArrayList<>();
      String sql = "select * from jos_fastball_schedule where location='"+jos_fastball_schedule.getLocation()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByField()
*/

public static List<Jos_fastball_schedule> findByField(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_schedule> list = new ArrayList<>();
      String sql = "select * from jos_fastball_schedule where field='"+jos_fastball_schedule.getField()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByStatus()
*/

public static List<Jos_fastball_schedule> findByStatus(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_schedule> list = new ArrayList<>();
      String sql = "select * from jos_fastball_schedule where status='"+jos_fastball_schedule.getStatus()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByBoxscored()
*/

public static List<Jos_fastball_schedule> findByBoxscored(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_schedule> list = new ArrayList<>();
      String sql = "select * from jos_fastball_schedule where boxscored='"+jos_fastball_schedule.getBoxscored()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByExtrainfo()
*/

public static List<Jos_fastball_schedule> findByExtrainfo(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_schedule> list = new ArrayList<>();
      String sql = "select * from jos_fastball_schedule where extrainfo='"+jos_fastball_schedule.getExtrainfo()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByInnings()
*/

public static List<Jos_fastball_schedule> findByInnings(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_schedule> list = new ArrayList<>();
      String sql = "select * from jos_fastball_schedule where innings='"+jos_fastball_schedule.getInnings()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByLinescore()
*/

public static List<Jos_fastball_schedule> findByLinescore(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_schedule> list = new ArrayList<>();
      String sql = "select * from jos_fastball_schedule where linescore='"+jos_fastball_schedule.getLinescore()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByHomeroster()
*/

public static List<Jos_fastball_schedule> findByHomeroster(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_schedule> list = new ArrayList<>();
      String sql = "select * from jos_fastball_schedule where homeroster='"+jos_fastball_schedule.getHomeroster()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByAwayroster()
*/

public static List<Jos_fastball_schedule> findByAwayroster(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_schedule> list = new ArrayList<>();
      String sql = "select * from jos_fastball_schedule where awayroster='"+jos_fastball_schedule.getAwayroster()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByHomestats()
*/

public static List<Jos_fastball_schedule> findByHomestats(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_schedule> list = new ArrayList<>();
      String sql = "select * from jos_fastball_schedule where homestats='"+jos_fastball_schedule.getHomestats()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByAwaystats()
*/

public static List<Jos_fastball_schedule> findByAwaystats(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_schedule> list = new ArrayList<>();
      String sql = "select * from jos_fastball_schedule where awaystats='"+jos_fastball_schedule.getAwaystats()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByRunshome()
*/

public static List<Jos_fastball_schedule> findByRunshome(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_schedule> list = new ArrayList<>();
      String sql = "select * from jos_fastball_schedule where runshome='"+jos_fastball_schedule.getRunshome()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByHitshome()
*/

public static List<Jos_fastball_schedule> findByHitshome(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_schedule> list = new ArrayList<>();
      String sql = "select * from jos_fastball_schedule where hitshome='"+jos_fastball_schedule.getHitshome()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByErrorshome()
*/

public static List<Jos_fastball_schedule> findByErrorshome(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_schedule> list = new ArrayList<>();
      String sql = "select * from jos_fastball_schedule where errorshome='"+jos_fastball_schedule.getErrorshome()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByRunsaway()
*/

public static List<Jos_fastball_schedule> findByRunsaway(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_schedule> list = new ArrayList<>();
      String sql = "select * from jos_fastball_schedule where runsaway='"+jos_fastball_schedule.getRunsaway()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByHitsaway()
*/

public static List<Jos_fastball_schedule> findByHitsaway(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_schedule> list = new ArrayList<>();
      String sql = "select * from jos_fastball_schedule where hitsaway='"+jos_fastball_schedule.getHitsaway()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByErrorsaway()
*/

public static List<Jos_fastball_schedule> findByErrorsaway(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_schedule> list = new ArrayList<>();
      String sql = "select * from jos_fastball_schedule where errorsaway='"+jos_fastball_schedule.getErrorsaway()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByScored()
*/

public static List<Jos_fastball_schedule> findByScored(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_schedule> list = new ArrayList<>();
      String sql = "select * from jos_fastball_schedule where scored='"+jos_fastball_schedule.getScored()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByGameinfo()
*/

public static List<Jos_fastball_schedule> findByGameinfo(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_schedule> list = new ArrayList<>();
      String sql = "select * from jos_fastball_schedule where gameinfo='"+jos_fastball_schedule.getGameinfo()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByChecked_out()
*/

public static List<Jos_fastball_schedule> findByChecked_out(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_schedule> list = new ArrayList<>();
      String sql = "select * from jos_fastball_schedule where checked_out='"+jos_fastball_schedule.getChecked_out()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByChecked_out_time()
*/

public static List<Jos_fastball_schedule> findByChecked_out_time(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_schedule> list = new ArrayList<>();
      String sql = "select * from jos_fastball_schedule where checked_out_time='"+jos_fastball_schedule.getChecked_out_time()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByPublished()
*/

public static List<Jos_fastball_schedule> findByPublished(Jos_fastball_schedule jos_fastball_schedule) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_schedule> list = new ArrayList<>();
      String sql = "select * from jos_fastball_schedule where published='"+jos_fastball_schedule.getPublished()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedulecon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByMapa()
*/

public static List<Jos_fastball_schedule> findByMapa(Map parametros) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
  List<Jos_fastball_schedule> list = new ArrayList<>();
  String sql = "select * from jos_fastball_schedule";
  if (parametros != null) {
      Iterator it = parametros.entrySet().iterator();
      StringBuilder sb = new StringBuilder("");
      int i = 0;
      while (it.hasNext()) {
          if (i != 0){
            sb.append(" and ");
         }
         i++;
        Map.Entry e = (Map.Entry) it.next();
        sb.append(e.getKey() +"= '"+  e.getValue()+"'");
      }
      if (!sb.toString().equals("")){
         sql = sql + " where " + sb.toString();
      }
   }
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedule con esa condición");
      esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* Double Func(String funcion, String campo)
*/



public static Double Func(String funcion, String campo) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return 0.0;
      }
      String sql = "select "+funcion+"("+campo+") as contador from jos_fastball_schedule";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedule ");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return 0.0;
   }
    Double tmp =0.0;
   rs.beforeFirst();
   while (rs.next()) {
    tmp =  rs.getDouble("contador");
    }
    rs.close();
    psquery.close();
    con.close();
 return tmp;
} catch (Exception ex) {
      excepcion = ex;
}
  return 0.0;
}


/**
*
* Double Func(String funcion, String campo,String where)
*/



public static Double Func(String funcion, String campo, String where) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return 0.0;
      }
      String sql = "select "+funcion+"("+campo+") as contador from jos_fastball_schedule where "+where +" ";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedule ");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return 0.0;
   }
    Double tmp =0.0;
   rs.beforeFirst();
   while (rs.next()) {
    tmp =  rs.getDouble("contador");
    }
    rs.close();
    psquery.close();
    con.close();
 return tmp;
} catch (Exception ex) {
      excepcion = ex;
}
  return 0.0;
}


/**
*
* Contador()
*/



public static Integer Contador() {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return 0;
      }
      String sql = "select count(*) as contador from jos_fastball_schedule";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedule ");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return 0;
   }
   rs.beforeFirst();
   while (rs.next()) {
    x =  rs.getInt("contador");
    }
    rs.close();
    psquery.close();
    con.close();
 return x;
} catch (Exception ex) {
      excepcion = ex;
}
  return 0;
}


/**
*
* Contador(String sqlquery)
*/



public static Integer Contador(String sqlquery) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return 0;
      }
      String sql = "select count(*) as contador from jos_fastball_schedule where  " + sqlquery +"";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedule ");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return 0;
   }
   rs.beforeFirst();
   while (rs.next()) {
    x =  rs.getInt("contador");
    }
    rs.close();
    psquery.close();
    con.close();
 return x;
} catch (Exception ex) {
      excepcion = ex;
}
  return 0;
}


/**
*
* Query()
*/

public static List<Jos_fastball_schedule> Query(String query) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
  List<Jos_fastball_schedule> list = new ArrayList<>();
  String sql = "select * from jos_fastball_schedule where " + query +"";
  if (query == null || query.equals("")) {
  return null;
   }
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedule con esa condición");
      esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* Listar()
*/

public static List<Jos_fastball_schedule> getLista(Map parametros) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
  List<Jos_fastball_schedule> list = new ArrayList<>();
  String sql = "select * from jos_fastball_schedule";
  if (parametros != null) {
      Iterator it = parametros.entrySet().iterator();
      StringBuilder sb = new StringBuilder("");
      while (it.hasNext()) {
        Map.Entry e = (Map.Entry) it.next();
        sb.append(e.getKey() +"="+  e.getValue());
      }
      if (!sb.toString().equals("")){
         sql = sql + " where " + sb.toString();
      }
   }
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_schedule");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
       
        Jos_fastball_schedule jos_fastball_schedule2 = new Jos_fastball_schedule(
         rs.getInt("id"),rs.getInt("season"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getInt("visitingteam"),rs.getInt("hometeam"),rs.getTimestamp("gamedatetime"),rs.getString("gametimezone"),rs.getInt("gametype"),rs.getInt("location"),rs.getString("field"),rs.getInt("status"),rs.getString("boxscored"),rs.getString("extrainfo"),rs.getInt("innings"),rs.getString("linescore"),rs.getString("homeroster"),rs.getString("awayroster"),rs.getString("homestats"),rs.getString("awaystats"),rs.getInt("runshome"),rs.getInt("hitshome"),rs.getInt("errorshome"),rs.getInt("runsaway"),rs.getInt("hitsaway"),rs.getInt("errorsaway"),rs.getBoolean("scored"),rs.getString("gameinfo"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_schedule2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
 }


/**
*
* Conectar()
*/



public static boolean Conectar() {
try {
 Sesion sesion = new Sesion();
  con = sesion.Conectar();
  if (con == null){
      return false;
   }
  return true;
  } catch (Exception ex) {
Mensajeria.MensajeError(ex, "Conectar()");
 }
    return false;
 }


}
